package com.yuanye.recruitCrawler.constant;

/** 
 * @author yuanye 2019年6月1日 下午2:09:35
 */
public class LagouConstant{
	public static final String homePage="https://www.lagou.com/";
	
	//城市
	public static final String quanguo="//*[@id=\"changeCityBox\"]/p[1]/a";
	public static final String beijing="//*[@id=\"changeCityBox\"]/ul/li[1]/a";
	public static final String shanghai="//*[@id=\"changeCityBox\"]/ul/li[2]/a";
	public static final String hangzhou="//*[@id=\"changeCityBox\"]/ul/li[3]/a";
	public static final String guangzhou="//*[@id=\"changeCityBox\"]/ul/li[4]/a";
	public static final String shenzhen="//*[@id=\"changeCityBox\"]/ul/li[6]/a";
	public static final String chengdu="//*[@id=\"changeCityBox\"]/ul/li[7]/a";
	public static final String wuhan="//*[@id=\"changeCityBox\"]/ul/li[8]/a";
	public static final String jiangsu="//*[@id=\"changeCityBox\"]/ul/li[9]/a";
	//关键词搜索
	public static final String searchInput="//*[@id=\"search_input\"]";
	public static final String searchButton="//*[@id=\"search_button\"]";
	//默认搜索条件
	public static final String java="//*[@id=\"sidebar\"]/div/div[1]/div[1]/div/a[1]";
	
	public static final String positionList="//*[@id=\"s_position_list\"]/ul/li";
	
	public static final String positionUrl="div[1]/div[1]/div[1]/a";
	public static final String positionName="div[1]/div[1]/div[1]/a/h3";
	public static final String salary="div[1]/div[1]/div[2]/div/span";
	public static final String experience="div[1]/div[1]/div[2]/div/text()";
	public static final String keyWords="div[2]/div[1]";
	public static final String attraction="div[2]/div[2]";
	public static final String companyUrl="div[1]/div[2]/div[1]/a";
	public static final String companyName="div[1]/div[2]/div[1]/a";
	public static final String industry="div[1]/div[2]/div[2]";
	public static final String companyLogo="div[1]/div[3]/a/img";
	public static final String address="div[1]/div[1]/div[1]/a/span/em";
	public static final String publishTime="div[1]/div[1]/div[1]/span";
	
	public static final String nextPage_a="//*[@class='pager_container']/a";
	public static final String nextPage_span="//*[@class='pager_container']/span";
	
	public static String getCityXpath(String city) {
		String xpath=null;
		switch (city) {
			case "beijing":
				xpath=beijing;
				break;
			case "shanghai":
				xpath=shanghai;
				break;
			case "hangzhou":
				xpath=hangzhou;
				break;
			case "guangzhou":
				xpath=guangzhou;
				break;
			case "chengdu":
				xpath=chengdu;
				break;
			case "wuhan":
				xpath=wuhan;
				break;
			case "jiangsu":
				xpath=jiangsu;
				break;
			default:
				xpath=quanguo;
				break;
		}
		return xpath;
	}
}